import { createRouter, createWebHashHistory } from 'vue-router'

// 路由懒加载
const Layout = () => import('@/views/Layout')
const Home = () => import('@/views/Home')
const Login = () => import('@/views/Login')
const Test = () => import('@/test/01-vue动画.vue')
const Product = () => import('@/views/Product/index.vue')

const routes = [
  {
    path: '/',
    component: Layout,
    children: [
      { path: '', component: Home },
      { path: '/product/:id', component: Product }
    ]
  },
  { path: '/login', component: Login },
  { path: '/test', component: Test }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
